package com.vhall.component.entity.goods.enums;

import com.vhall.component.entity.dictionary.enums.BaseEnum;
import lombok.Getter;

/**
 * GuoxinPrdTypeEnum-
 *
 * @author xing.wang
 * @date 2023/8/22
 */
@Getter
public enum GuoxinPrdTypeEnum implements BaseEnum {
    TYPE_1(1,"VIP资讯")
    ,TYPE_2(2,"策略工具")
    ,TYPE_3(3,"基金投顾策略")
    ,TYPE_4(4,"鑫汇盈")
    ,TYPE_5(5,"组合")
    ,TYPE_6(6,"ETF")
    ,TYPE_7(7,"公募基金")
    ;

    private final Integer value;
    private final String name;

    GuoxinPrdTypeEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    @Override
    public Integer getValue() {
        return value;
    }

    @Override
    public String getName() {
        return name;
    }

    /**
     * 通过 value 获取 name
     * @param value
     * @return
     */
    public static String getNameByValue(Integer value) {
        for (GuoxinPrdTypeEnum e : GuoxinPrdTypeEnum.values()) {
            if (e.getValue().equals(value)) {
                return e.getName();
            }
        }
        return null;
    }
}
